<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/comment/comment.jsp" %>
<%--<script src="js/jquery-1.8.2.min.js"></script>--%>
<body>
<div class="soubg">
    <div class="sou">
        <span class="fr">
        	<span class="fl">你好，请<a href="client/Login.jsp">登录</a>&nbsp; <a href="client/Regist.jsp"
                                                                            style="color:#ff4e00;">免费注册</a>&nbsp;
			<a href="loginByCode.html" style="color:#ff4e00;">验证码登录</a>&nbsp;<a href="#" style="color:#ff4e00;">微信登录</a>&nbsp;
                |<a href="#">我的订单</a>&nbsp;|<a href="#">后台管理</a>&nbsp;|<a href="#">注销</a>
        </span>
        </span>
    </div>
</div>
<div class="log_bg">
    <div class="top">
        <div class="logo"><a href="Index.jsp"><img src="images/logo.png"/></a></div>
    </div>
    <div class="login">
        <div class="log_img"><img src="images/l_img.png" width="611" height="425"/></div>
        <div class="log_c">
            <form id="myForm">
                <input type="hidden" name="action" value="login"/>
                <table border="0" style="width:370px; font-size:14px; margin-top:30px;" cellspacing="0" cellpadding="0">
                    <tr height="50" valign="top">
                        <td width="55">&nbsp;</td>
                        <td>
                            <span class="fl" style="font-size:24px;">登录</span>
                            <span class="fr">还没有商城账号，<a href="Regist.jsp" style="color:#ff4e00;">立即注册</a></span>
                        </td>
                    </tr>
                    <tr height="70">
                        <td>用户名</td>
                        <td><input type="text" value="${cookie.account.value}" class="l_user" name="account"
                                   id="account"/></td>
                    </tr>
                    <tr height="70">
                        <td>密&nbsp; &nbsp; 码</td>
                        <td><input type="password" value="${cookie.password.value}" class="l_pwd" name="password"
                                   id="password"/></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td style="font-size:12px; padding-top:20px;">
                	<span style="font-family:'宋体';" class="fl">
                    	<label class="r_rad"><input type="checkbox" name="remember"/></label><label class="r_txt">请保存我这次的登录信息</label>
                    </span>
                            <span class="fr"><a href="#" style="color:#ff4e00;">忘记密码</a></span>
                        </td>
                    </tr>
                    <tr height="60">
                        <td>&nbsp;</td>
                        <td><input type="button" value="登录" class="log_btn"/></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<!--End Login End-->
<!--Begin Footer Begin-->
<%@include file="/comment/version.jsp" %>
<!--End Footer End -->

</body>

<script>
    $(function () {
        $(".log_btn").click(function () {
            //获取数据
            var account = $("#account").val();
            var password = $("#password").val();

            //判断用户名是否为空
            if (account == "") {
                alert("用户名不能为空!");
                return;
            }

            //判断密码是否为空
            if (password == "") {
                alert("密码不能为空!");
                return;
            }

            $.ajax({
                url: "UserServlet",
                type: "post",
                data: $("#myForm").serialize(),
                dataType: "text",
                success: function (data) {
                    if (data == "登录成功") {
                        alert(data);
                        location.href = "client/Index.jsp";
                    } else {
                        alert(data);
                    }
                }
            })
        })
    })
</script>

<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>